package doublelinkedlist;

import java.util.Scanner;

public class PlusString {

		private 	String s1;

		public void input(){
			System.out.println("input: ");
			s1= new Scanner(System.in).next();
		}
		public void plus(String s2){
			String t1="",t2="";	// t1 is String reverse of t2 , t2 is String need be found;
			int t,tu,du=0;String x1,x2;
			if(s1.length()>s2.length())
			{	x1=s1;
				x2=s2;
			}
			else{ 
				x1=s2;
				x2=s1;
			}
			for(int i=x1.length()-1,j=x2.length()-1;i>=0;i--,j--){
				if(j>=0)t= Integer.parseInt(x1.charAt(i)+"")+Integer.parseInt(x2.charAt(j)+"")+du;
				else t=Integer.parseInt(x1.charAt(i)+"")+du;
				tu=t%10;
				du = t/10;
				t1+=tu+"";
			}	
			if(du!=0)t1+=du+"";
			for(int i=t1.length()-1;i>=0;i--)
				t2+=""+t1.charAt(i);
			System.out.println(s1+" + "+s2+" = "+t2);
		}

		public static void main(String []agrs){
			PlusString p= new PlusString();
			PlusString t= new PlusString();
			p.input();
			t.input();
			p.plus(t.s1);

		}
	}


